﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SmartMeterParamSetting.UI
{
    /// <summary>
    /// UI.xaml 的交互逻辑
    /// </summary>
    public partial class UI_Power : Window
    {
        public UI_Power()
        {
            InitializeComponent();
        }

        public float PowerValue
        {
            get;
            private set;
        }


        private void Btn_Cancel_Click(object sender, RoutedEventArgs e)
        {

            this.DialogResult = false;
            this.Close();
        }

        private void Btn_Power_Click(object sender, RoutedEventArgs e)
        {
            float outdata;
            if (!float.TryParse(Cmb_Power.Text, out outdata))
            {
                MessageBox.Show("升源电压必须是一个数字...", "输入错误", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            PowerValue = outdata;

            this.DialogResult = true;

            this.Close();

        }
    }
}
